package com.zfx.util;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: zfx
 * @version: 1.0
 * @time: 2020-05-08 13:18
 * <p>
 * 修改历史：
 * 修改日期      修改人员    版本    内容
 * 2020-05-08   zfx       1.0
 */
@Getter
@Setter
public class JsonObject {

    private String code;
    private String msg;
    private Integer dataSize;
    private Map<String, Object> data = new HashMap<>();

    public JsonObject() { }

    public JsonObject(JsonMsg jsonMsg) {
        this.code = jsonMsg.getCode();
        this.msg = jsonMsg.getMsg();
    }

    public JsonObject(String code, String msg,Integer dataSize) {
        this.code = code;
        this.msg = msg;
        this.dataSize=dataSize;
    }

    public void setData(String key, Object value) {
        data.put(key, value);
    }
}
